<?php
$query = 'SELECT * FROM maklumat_kursus';
     $result = mysql_query($query) or die('<p class="db_error"><b>A fatal MySQL error occurred while trying to select <b>'.reverb($_POST['id']).'</b> from the database.</b><br />Query: '.$query.'<br />Error: ('.mysql_errno().') '.mysql_error().'</p>');
echo '<table>';
echo '<tr>';
          echo "<td>id</td>";
          echo "<td>gred</td>";
          echo "<td>tempoh_perkhidmatan</td>";
          echo "<td>scdp</td>";
          echo "<td>cdp</td>";
          echo "<td>skim</td>";
          echo "<td>jawatan</td>";
          echo "<td>jabatan</td>";
echo '</tr>';
     while ($row = mysql_fetch_assoc($result)) { 
echo "<tr>";
          echo "<td>".$row['id']."</td>";
          echo "<td>".$row['gred']."</td>";
          echo "<td>".$row['tempoh_perkhidmatan']."</td>";
          echo "<td>".$row['scdp']."</td>";
          echo "<td>".$row['cdp']."</td>";
          echo "<td>".$row['skim']."</td>";
          echo "<td>".$row['jawatan']."</td>";
          echo "<td>".$row['jabatan']."</td>";
echo "</tr>";
     }//end while
echo '</table>';?>